package com.hawk.eye.server.convert;

import com.hawk.eye.server.domain.dto.req.DictReqDTO;
import com.hawk.eye.server.domain.dto.resp.DictDataRespDTO;
import com.hawk.eye.server.domain.po.DictData;
import com.hawk.eye.server.domain.vo.req.DictReqVO;
import com.hawk.eye.server.domain.vo.resp.DictDataRespVO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zd
 */
@Mapper
public interface DictConvert {

    DictConvert INSTANCE = Mappers.getMapper(DictConvert.class);

    @IterableMapping(qualifiedByName = "to2")
    List<DictDataRespDTO> to4(List<DictData> selectDictTypeList);

    @Named(value = "to2")
    DictDataRespDTO to2(DictData dictData);

    @Named(value = "to6")
    DictDataRespVO to6(DictDataRespDTO dictData);

    @IterableMapping(qualifiedByName = "to6")
    List<DictDataRespVO> to6(List<DictDataRespDTO> selectDictTypeList);

    DictReqDTO to(DictReqVO reqVO);

}